package com.app.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;
import java.util.List;

/**
 * 管理员用户表
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("lm_admin_user")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AdminUserModel {
    @TableId(type = IdType.AUTO)
    private Integer id; //管理员用户表
    private String username;//账号
    private String password;//密码
    private String realName;//真实姓名
    private Integer roleId;//角色表ID
    private String roleName;//身份角色名称  角色表姓名
    private String lastLoginIp;//最近登录IP
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") //后端注解格式化日期
    private Timestamp lastLoginTime;//最近登录时间
    private String phone;//手机号
    private Integer phoneStatus;//手机号
    private Integer status;//管理员状态 1有效0无效
    private Integer unitsId;//单位管理表id(lm_units_manage)

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") //后端注解格式化日期
    private Timestamp createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") //后端注解格式化日期
    private Timestamp updateTime;
    @TableField(exist = false)
    private String token;
    @TableField(exist = false)
    private String unitsName;//单位管理表名称(lm_units_manage)

    @TableField(exist = false)
    private List<String> permissionList;//权限数组

}
